package uy.edu.um.ltic.server.persistence;

import static org.junit.Assert.*;

import org.junit.Test;

import uy.edu.um.ltic.exception.DataBaseException;

public class testingSpecialWordReport {

	@Test
	public void test() {
		MessageDAOMgt oMessage = MessageDAOFactory.getInstance().getMessageDAOMgt();
		try {
			assertEquals(oMessage.getMessagesWithTheWord("Hi").get(0).getSender().getnEmployee(), 1);
			assertEquals(oMessage.getMessagesWithTheWord("you").get(0).getSender().getnEmployee(), 1);
			assertEquals(oMessage.getMessagesWithTheWord("you").get(1).getSender().getnEmployee(), 1);
			assertEquals(oMessage.getMessagesWithTheWord(" ").get(0).getSender().getnEmployee(), 5);
			assertEquals(oMessage.getMessagesWithTheWord(" ").get(1).getSender().getnEmployee(), 6);
			assertEquals(oMessage.getMessagesWithTheWord(" ").get(2).getSender().getnEmployee(), 6);
			assertEquals(oMessage.getMessagesWithTheWord(" ").get(3).getSender().getnEmployee(), 5);
			assertEquals(oMessage.getMessagesWithTheWord(" ").get(4).getSender().getnEmployee(), 6);
			assertEquals(oMessage.getMessagesWithTheWord(" ").get(5).getSender().getnEmployee(), 5);
			assertEquals(oMessage.getMessagesWithTheWord(" ").get(6).getSender().getnEmployee(), 1);
			assertEquals(oMessage.getMessagesWithTheWord(" ").get(7).getSender().getnEmployee(), 1);
			assertEquals(oMessage.getMessagesWithTheWord(" ").get(7).getText(), "How are you?");
			assertEquals(oMessage.getMessagesWithTheWord(" ").get(0).getReceivers().get(0).getnEmployee(), 6);
		} catch (DataBaseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}		
		
	} 

}
